package com.game.framework.common;

public enum TicketTypeEnum {
    NO_TICKET(0,"无门票"),
    INITIAL_TICKET(1,"初级门票"),
    MIDDLE_TICKET(2,"中级门票"),
    HIGHT_TICKET(3,"高级门票");

    private final int type;
    private final String desc;

    TicketTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }


    public int getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }


    public static TicketTypeEnum get(Integer type) {
        switch (type) {
            case 1:
                return INITIAL_TICKET;
            case 2:
                return MIDDLE_TICKET;
            case 3:
                return HIGHT_TICKET;
            case 0:
            default:
                return NO_TICKET;
        }
    }

    public static String getDesc(Integer type) {
        switch (type) {
            case 1:
                return INITIAL_TICKET.desc;
            case 2:
                return MIDDLE_TICKET.desc;
            case 3:
                return HIGHT_TICKET.desc;
            case 0:
            default:
                return NO_TICKET.desc;
        }
    }
}
